部署 yolov7 目标检测


1.准备:
提前安装好必要程序,以免安装 yolov7 时报错。
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
sudo apt-get install python3-pip
sudo apt-get install python-is-python3

2.安装 yolov7:
项目地址:https://github.com/WongKinYiu/yolov7
git clone https://github.com/WongKinYiu/yolov7.git
cd yolov7
pip install -U -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
下载过程比较缓慢,请耐心等待。

3.运行 yolov7:
检测本地图片。默认位置:/yolov7/inference/images中。
输出位置:/yolov7/runs/detect/ 中。
注:运行 yolov7 时会自动安装一些配置文件。
python detect.py
实时检测摄像头中的目标:
python detect.py --weights yolov7.pt --source 0